Shadow passΒΆ

The Help > Samples > Shadow Pass sample for the setup details.

To composite CG objects into an existing image, you may need a shadow pass image.

The original image, the props to add, the shadow pass and the final result.

The shadow pass can be computed rendering the virtual ground twice, with and without shadows.

Render the ground without shadow

We assume here you have setup some render layers to get the props and the ground rendered separetly, with shadows.

To render the ground without shadow, we will create a new RenderPass. We will need a dedicated RenderGraph, which remove the shadows, connected to this RenderPass.

  1. Duplicate the render pass as NoShadow.
  2. In this new render pass, keep the Ground layer and delete all the other layers.
  3. Create a new Create/RenderGraph which removes all from the Shadows set, like this

  4. Set the NewRenderGraph > RenderGraph > Order to 10, to make sure it is evaluated after the main RenderGraphs.
  5. Press NewRenderGraph > RenderGraph > Edit and connect the new RenderGraph to the NoShadow render pass. This RenderGraph is now evaluated only for the NoShadow render pass.

The ground rendered with and without shadows.

Compute and use the shadow pass
  1. In a compositing tool, import all the images.
  2. Divide the ground with shadow image by the ground without shadow image.
  3. Multiply the result by the orignal image.

The whole compositing setup computing the shadow mask and a compositing preview.

The result of the divide, the result of the multiply.